<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/WEB-INF/webpage/common/taglibs.jspf" %>
<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="cc.zcdMx.orderSplit"/></title>
    <meta name="decorator" content="form"/>
    <html:css name="bootstrap-fileinput"/>
    <html:css name="simditor,jqgrid"/>
</head>
<body class="white-bg">
<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
    <tbody>
    <tr>
        <td class="width-15 active text-right">
            <label><font color="red">*</font>拆分个数:</label>
        </td>
        <td class="width-35">
            <input id="number" class="form-control" datatype="*" nullmsg="请填写拆分个数！" htmlEscape="false"/>
            <label class="Validform_checktip"></label>
        </td>
    </tr>
    </tbody>
</table>
<html:js name="bootstrap-fileinput"/>
<html:js name="simditor,jqgrid,jqGrid_curdtools,jqGrid_curdtools_inline"/>
<script>
    $(document).ready(function () {
        $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
            resizeGrid();
        });
    });
    $(function () {
        $(window).resize(function () {
            resizeGrid();
        });
    });

    /* 父页面点击确定时触发的事件 */
    function confirm(callback) {
        var number = $("#number").val();
        if (!isNull(number)){
            var shijJs = parseInt('${shijJs }');
            number = parseInt(number);
            if ( shijJs < number || number < 2) {
                top.layer.alert('请重新输入拆分个数!', {icon: 0, title: '警告'});
                return;
            }
        }else{
            top.layer.alert('请重新输入拆分个数!', {icon: 0, title: '警告'});
            return;
        }


        // POST请求配送交接
        $.ajax({
            type: "POST",
            url: "${adminPath}/cc/zcd/mx/zcdSplit",
            data: {
                zhuangcdId: '${zhuangcdId }',
                number: number
            },
            traditional: true,
            success: function (data) {
                top.layer.alert(data.msg, {icon: 0, title: '提示'});
                if (data.ret == 0) {
                    // 最后调用回调函数，关闭对话框
                    if (typeof callback == "function") {
                        callback();
                    }
                }
            }
        });
    }
</script>
</body>

</html>
